package com.ruoyi.myplayer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.myplayer.mapper.PlayerVideoMapper;
import com.ruoyi.myplayer.domain.PlayerVideo;
import com.ruoyi.myplayer.service.IPlayerVideoService;

/**
 * 视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-12
 */
@Service
public class PlayerVideoServiceImpl implements IPlayerVideoService 
{
    @Autowired
    private PlayerVideoMapper playerVideoMapper;

    /**
     * 查询视频
     * 
     * @param id 视频主键
     * @return 视频
     */
    @Override
    public PlayerVideo selectPlayerVideoById(Long id)
    {
        return playerVideoMapper.selectPlayerVideoById(id);
    }

    /**
     * 查询视频列表
     * 
     * @param playerVideo 视频
     * @return 视频
     */
    @Override
    public List<PlayerVideo> selectPlayerVideoList(PlayerVideo playerVideo)
    {
        return playerVideoMapper.selectPlayerVideoList(playerVideo);
    }

    /**
     * 新增视频
     * 
     * @param playerVideo 视频
     * @return 结果
     */
    @Override
    public int insertPlayerVideo(PlayerVideo playerVideo)
    {
        playerVideo.setCreateTime(DateUtils.getNowDate());
        return playerVideoMapper.insertPlayerVideo(playerVideo);
    }

    /**
     * 修改视频
     * 
     * @param playerVideo 视频
     * @return 结果
     */
    @Override
    public int updatePlayerVideo(PlayerVideo playerVideo)
    {
        return playerVideoMapper.updatePlayerVideo(playerVideo);
    }

    /**
     * 批量删除视频
     * 
     * @param ids 需要删除的视频主键
     * @return 结果
     */
    @Override
    public int deletePlayerVideoByIds(Long[] ids)
    {
        return playerVideoMapper.deletePlayerVideoByIds(ids);
    }

    /**
     * 删除视频信息
     * 
     * @param id 视频主键
     * @return 结果
     */
    @Override
    public int deletePlayerVideoById(Long id)
    {
        return playerVideoMapper.deletePlayerVideoById(id);
    }

    @Override
    public List<PlayerVideo> getHotMvLst(PlayerVideo playerVideo) {
        return playerVideoMapper.getHotMvLst();
    }
}
